# -*- coding: utf-8 -*-
"""
Created on Wed May 20 11:09:01 2020

@author: Long
"""

import openpyxl
import xlrd

def write_excel_xlsx(path, sheet_name, value):
    index = len(value)
    workbook = openpyxl.Workbook()
    sheet = workbook.active
    sheet.title = sheet_name
    for i in range(0, index):
        for j in range(0, len(value[i])):
            sheet.cell(row=i+1, column=j+1, value=str(value[i][j]))
    workbook.save(path)
    print("xlsx格式表格写入数据成功！")
    
file_path = r'Z:\\陈佳\\5.3破壁事业部看板\\PB实际表.xlsx'
#获取数据
data = xlrd.open_workbook(file_path)
table = data.sheet_by_name('核销')
print('读取中')
row1 = table.nrows



Type_Dict5 = {}  
dict1 = xlrd.open_workbook(r'Z:/陈佳/5.3破壁事业部看板/销售出货流水账.xlsx')#载入字典
table1 = dict1.sheet_by_name('Sheet1')
row2 = table1.nrows 
for i in range(1,row2):
    values = table1.row_values(i)
    Type_Dict5[values[35]+values[43]] = values[12]
    
for i in range(1,row1):
    values = table.row_values(i)
    if values[50] == "":
        values[3]+values[16]
        print 
    
